//Header file definition for ray that uses a Vector3 notation internally
#ifndef __RAY3_H__
#define __RAY3_H__

#pragma once
#include "Vector.h"

class Ray3
{
public:
	Vector3 origin;
	Vector3 direction;
	
	//constructor
	Ray3();
	Ray3(const Vector3& o, const Vector3& d);
	Ray3(const Vector3& o, const Vector3& d, bool normalized);		// normalize the ray when creating

	//functions
	Vector3 PointAt(float t);		//get vector at t distance from origin
	void NormalizeRay();			//Normalize the ray
	bool RayIntersection(Ray3& R2, float& t1, float& t2);	// Ray ray intersection
};

// Utility structure
// This structure contains a number of rays and a variable indicating the number of rays in this packet
// This is basically used for multisampling where many rays are needed for a particular pixel
struct RayPacket
{
	Ray3* pRays;		// pointer to rays
	int n_rays;			// number of rays;
};

#endif